package org.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.sql.Timestamp;

/**
 * 借阅记录实体类
 */
@Data
@Schema(description = "借阅记录实体类")
public class BorrowRecord {
    @TableId(type = IdType.AUTO)
    @Schema(description = "自增主键")
    private Long id;
    
    @Schema(description = "用户ID")
    private Long userId;
    
    @Schema(description = "图书ID")
    private Long bookId;
    
    @Schema(description = "借阅时间")
    private Timestamp borrowTime;
    
    @Schema(description = "计划归还时间")
    private Timestamp planReturnTime;
    
    @Schema(description = "实际归还时间")
    private Timestamp actualReturnTime;
    
    @Schema(description = "续借次数")
    private Integer renewCount;
    
    @Schema(description = "状态(0:已取消,1:借阅中,2:已归还,3:已逾期)")
    private Integer status;
    
    @Schema(description = "创建时间")
    private Timestamp createTime;
    
    @Schema(description = "更新时间")
    private Timestamp updateTime;
    
    // 非数据库字段，用于前端展示
    @TableField(exist = false)
    @Schema(description = "图书标题")
    private String bookTitle;
    
    @TableField(exist = false)
    @Schema(description = "图书封面")
    private String coverUrl;
    
    @TableField(exist = false)
    @Schema(description = "图书作者")
    private String author;
    
    @TableField(exist = false)
    @Schema(description = "用户名")
    private String username;
} 